perm filename CKSUM.DON[UP,DOC]6 blob sn#487626 filedate 1979-12-11 generic text, type T, neo UTF8
CKSUM lets you "keep track" of E-format files, in the sense that when they
change it will tell you which pages the changes are on.  Two typical
applications would be (1) a large source file, where you don't want to sit
through the ATSIGN program just to learn which sections have changed, and
(2) the BBOARD and GRIPES files, where you might not want to scan the E
directory for changes and/or want to find out where some loser added a
comment without doing an NDBBOARD command to update the directory line.

As with most programs, CKSUM has all sorts of obscure features.  This
documentation describes them all, and can thus be somewhat imposing if you
just want to do something simple.  There are some examples at the end
detailing how you would do some of the simpler things.

CKSUM operates by computing a 36-bit checksum (not a straight longitudinal
checksum) for each page of the file, not counting the directory page.  The
file MUST be in E format -- in particular, pages must start on record
boundaries.  The checksums, along with the date and time the file was last
written, are kept in the file CKSUM.DAT on your master ([1,xxx]) account.
(If you don't have a [1,xxx] account, you lose.  Create one.)  One
CKSUM.DAT file may contain data for any number of checksummed files.  You
can ask about changes in any or all of the files in one run of CKSUM.

When reporting changes, CKSUM does its best to figure out what has actually
happened to the file.  If pages have moved around without being changed, it
reports where they have moved to.  If pages have been deleted or added with
no other changes occurring, it reports that.  But if deletions or additions
occur together with other changes, CKSUM has no way of knowing which pages
were deleted/added and which changed; in this case it reports the change in
the total number of pages and says which pages in the new file fail to
match any in the old one.

To use CKSUM, the general format is:

.R CKSUM;{files}{switch}

(If both "files" and "switch" are omitted, the semicolon is unnecessary.)
The optional "files" field is a list of file names, separated by commas.
Filehacks (e.g., \M) ARE recognised, but the partial-sign construct is NOT.
Down-arrows may be used to quote odd characters as usual.  If no list of
files is given, then the default is to operate on all the files in
CKSUM.DAT, though you can change this using file classes (see below);
otherwise, only the files named will be used and any not yet in
CKSUM.DAT will be added to it.  (You'll be asked to confirm adding new
files, as a hedge against typoes.)  If CKSUM.DAT does not yet exist, you'll
be asked to confirm initialising, and if you did not give a list of files
you'll be asked again for one; typing a null line to this request gets you
a default of BBOARD and GRIPES.

No more than one switch is allowed.  The available switches are:

/DELETE	    delete (selected) entries from CKSUM.DAT; you'll be asked
	    to confirm this.
/LIST	    just list (selected) files in CKSUM.DAT, together with the
	    date and time of the last checksummed version, and the
	    number of pages in each.
/READONLY   report changes as usual, but don't store the new checksums
	    in CKSUM.DAT (normal operation is to store the new checksums
	    so that you hear of each change only once).
/SORT	    ignore {files}; show the current list of checksummed files
	    and reorder them in CKSUM.DAT as directed (instructions are
	    provided by the program at that time).
/WRITE	    override automatic /READONLY for file classes (see below).

Switches may be abbreviated to single letters.  If any switch except /W is
present, then any new files in the "files" parameter are reported and
ignored, since /D, /L, /R, and /S all imply that nothing is to be added to
CKSUM.DAT.  With /S, the "files" (new or old) are completely ignored; new
files are not reported.  Also, a null "files" parameter is forbidden with
the /D switch -- if you really want to do that, just delete CKSUM.DAT.
(It's kept delete-protected as a precaution, but you can of course
override that.)

After CKSUM has exited, if it reported any new or altered pages (as opposed
to just deleted pages and unchanged files), you can type CONTINUE and CKSUM
will swap to E with the file stack containing the file(s) with new/altered
pages and each file having a "mark" placed at the top of each such page.
(You can also request that the marks be at the ends of pages; see below.)
Thus you can then use αM commands to look at pages until you come back to
one you've already seen, then use α+αH to get to the next file, etc.
Note that this destroys the tmpcor file used by E to remember the last few
files you edited prior to running CKSUM.

If, after CKSUM has exited, you decide there have been too many changes for
you to look at right away, you can type REENTER and CKSUM will restore the
CKSUM.DAT file to its previous state, such that you'll hear about the same
changes again the next time you look.  (Or you can then run CKSUM again but
select a subset of the files to look at.)

CKSUM also lets you specify up to 27 "classes" of files, identified by the
letters A through Z and the digit 0.  By default, all files start out in
class 0.  Each file class has a set of flags associated with it, selecting
various options affecting files in that class.  Each option corresponds to
a bit in a 9-bit field (sort of like file protections), as follows:

bit	  option			   description
---	-----------	---------------------------------------------------
001	implicit /R	Files in this class are automatically treated as
			/READONLY; that is, changes to the files will be
			reported but the new checksums will not be saved.
			This lets you keep track of the cumulative changes
			to some files while looking at day-to-day changes
			in others.  You can force CKSUM to save the new
			checksums for these files via the /WRITE switch.
002	exclusion	Files in this class are NOT processed if you run
			CKSUM without giving an explicit list of files
			(either by name or by file class).
004	mark bottom	If you swap to E, the marks in these files will be
			at the bottoms of the pages instead of the tops.
010	change only	Files in this class will not be mentioned at all
			unless they have been written since the last time
			they were checksummed.
020	no E dir	CKSUM will not warn you if these files lack a valid
			E directory.
040	invis changes	If a file in this class is changed (as indicated by
			its date-last-written) but no new pages are found
			and no pages were deleted, the file will still be
			included in the list if you ask CKSUM to swap to E.
700	   --		The remaining option bits are currently unused.

The initial defaults are 0 for class 0 and 1 (readonly) for classes A-Z.

To change the class a file is in, include in the {files} parameter the file
name followed by =X where X is the class to put it in.  Thus, for example,
R CKSUM;\BBOARD=X,\GRIPES=Y puts the BBOARD file in class X and the GRIPES
file in class Y.  When you specify a class for a file, that file will not
be checksummed during that particular run of CKSUM unless you explicitly
list the file a second time, as in R CKSUM;FOO=X,FOO.  (Similarly, if in
addition to changing some files' classes, you include files in the {files}
list without any "=" specification, those files will be checksummed as
usual, or listed or deleted depending on the /L and /D switches.)

You can also use classes in place of file names.  A list of one or more
file classes enclosed in parentheses is equivalent to listing all the files
in those classes.  Thus, after the above class-setting example, the command
R CKSUM;(XY) would show changes to BBOARD and GRIPES (but would not save
the new checksums, since classes X and Y default to /R).  R CKSUM;(X)/W
would show changes to BBOARD and WOULD save the new checksums for it, and
R CKSUM;(Y)=0,(X)/D would delete BBOARD from the checksum file and also put
GRIPES into class 0.  The special specification (∀) requests ALL classes.

To change the option bits associated with a file class, give the file class
(or classes) in parentheses and follow the close parenthesis with a colon
and then the octal value obtained by ORing the desired bits.  For example,
R CKSUM;(0B):4,(XY):5 would specify that classes 0, B, X, and Y all get
marks placed at the bottoms of pages instead of the top, and that X and Y
are readonly (unless overridden by /WRITE) while 0 and B are not (unless
explicitly requested by /READONLY).  A typical setting is "(∀):3,(0):14",
such that you only check on files in class 0 unless you explicitly ask for
the others (probably via something like R CKSUM;(X) ), and for the
frequently-checked files (class 0) you're not told about lack of changes.
It also makes files outside class 0 default to /R and files in class 0
have marks put at the bottoms of pages.

One last note regarding classes: the /L output includes the file class
in parentheses for all files listed that are not in class 0, and also lists
the option settings for classes included in the command line (all classes
if none were mentioned in the command line) that have non-default settings.

If a file you have been checksumming gets renamed, CKSUM will complain that
it can no longer find the file.  You could just delete the file from your
list and add the new name, but that would mean recomputing all the checksum
information for that file and thus missing out on hearing about changes
that occurred around the time of the rename.  To handle this situation, you
can tell CKSUM that the file has moved by including <newname>←<oldname>
somewhere in the {files} list.  Just as when you change a file's class, the
rename entry in the {files} does not cause the file to get checksummed this
time around unless you explicitly list the (new) name a second time.  You
can combine renaming with class-changing, as in FOO←BAR=X.

Note: CKSUM does not bother recomputing checksums unless the file in
question has been changed (based on date/time last written), so it should
be moderately fast when there's nothing to report.  If the only change has
been an invisible one like updating the E directory (via E's αXUPDATE
command) without changing any other pages, or "burping" one or more pages,
CKSUM will report that the file has been edited with no visible effect.

If you ask to checksum a file that lacks a valid E directory, CKSUM will
complain (unless the file belongs to a class with the "no E dir" option),
but it will still compute the checksums for any pages (other than page 1)
which happen to start on record boundaries.  Thus, in particular, if you
checksum a one-page file, you will be informed thereafter whenever the file
is edited, even though CKSUM will be unable to find any differences.  By
using the "no E dir" and "invis changes" options, you can get CKSUM to
include the file in the list when you swap to E.

One final note:  If you have a CKSUM.DAT file, then the CKMAIL command
(abbreviated CK) will swap to CKSUM after reporting whether you have new
mail or news notifications, unless you tell it you want to check somebody's
mail other than your own.  Since CKMAIL ignores everything out to the first
space, you can even say things like CK/R or CK(X)/W and get away with it.

RELATIVELY SIMPLE EXAMPLES

The preceding documentation is somewhat exhaustive; if all you want to do
is some relatively simple stuff, these examples may help.  First, if all
you want to do is keep track of BBOARD and GRIPES:

.R CKSUM;\B,\G		(the first time)
.R CKSUM		(thereafter)

You might want to have the marks placed at the ends of pages in those
files, since that's where new stuff shows up.  In that case, either

.R CKSUM;\B,\G,(0):4	(the first time)

or

.R CKSUM;(0):4		(if you think of it after already running CKSUM
			for the first time)

If you want to keep an eye on the BBOARD and GRIPES files from day to day,
and also have a source file MUMBLE.SAI in which you want to be able to
identify changed pages for spooling after an edit (and thus you don't want
to check it every day -- just after an edit):

.R CKSUM;\B,\G,(0):4,MUMBLE.SAI=X,(X):3,(∀)

What this does is put BBOARD and GRIPES into class 0 with marks at ends of
pages, as before, and also puts MUMBLE.SAI into class X with the exclusion
and readonly bits selected.  The ",(∀)" tells CKSUM to include MUMBLE.SAI
on the *initial* run (overriding the newly-set exclusion bit) so that it
will compute the initial checksums for that file.  On later runs:

.R CKSUM		(tells you about changes in BBOARD and GRIPES)
.R CKSUM;(X)		(tells you about changes in MUMBLE.SAI so you can
			spool the altered pages)
.R CKSUM;(X)/W		(same as without /W but also updates the checksums
			for MUMBLE.SAI in the CKSUM.DAT file, so you won't
			get told about those changes again)

Comments, suggestions, bugs, etc., via GRIPE CKSUM.